/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SPARQL;

import java.util.Objects;

/**
 *
 * @author riccardo
 */
public class SimpleURI extends URI{
    
    private String uri;

    public SimpleURI(String uri) {
        this.uri = uri;
    }

    @Override
    public String getUri() {
        return uri;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 83 * hash + Objects.hashCode(this.uri);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if(obj instanceof SimpleURI){
            final SimpleURI other = (SimpleURI) obj;
            if (!Objects.equals(this.uri, other.uri)) {
                
                return false;
            }
        }
        else if(obj instanceof PrefixedURI){
            final PrefixedURI other1 = (PrefixedURI) obj;
            if (!Objects.equals(this.uri, other1.getSimpleURI().uri)) {
                return false;
            }
        }
        else return false;
        return true;
    }

    @Override
    public String toString() {
        return "<"+uri+">";
    }

    @Override
    public Object clone(){
        return new SimpleURI(uri);
    }
}
